package com.example.demovalidator.entity;

import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import javax.validation.constraints.PastOrPresent;
import java.time.LocalDateTime;

/**
 * @author lxw
 * @date 2021/8/9
 * @apiNote
 */
@Data
public class Student {

    /**
     * id
     */
    @Null(message = "主键不可有值")
    private Integer id;
    /**
     * 姓名
     */
    @NotBlank(message = "姓名不能为空")
    private String name;
    /**
     * 性别
     */
    @NotBlank(message = "性别不能为空")
    private String sex;
    /**
     * 创建时间
     */
    @NotNull(message = "时间不能为空")
    @PastOrPresent(message = "时间格式不对")
    private LocalDateTime createTime;
}
